package cn.jhc.bean;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

@Entity
@Table(name="teach")
public class Study {
	private Integer teachid;
	private Date teachtime;
	private Course course;
	private Clazz clazz;
	private Teacher teacher;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="TEACHID")
	public Integer getTeachid() {
		return teachid;
	}
	public void setTeachid(Integer teachid) {
		this.teachid = teachid;
	}
	@Column(name="TEACHTIME")
	public Date getTeachtime() {
		return teachtime;
	}
	public void setTeachtime(Date teachtime) {
		this.teachtime = teachtime;
	}
	@ManyToOne()
	@Cascade (org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@JoinColumn(name="COURSENO",nullable=false)
	public Course getCourse() {
		return course;
	}
	public void setCourse(Course course) {
		this.course = course;
	}
	@ManyToOne()
	@Cascade (org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@JoinColumn(name="CLASSNO",nullable=false)
	public Clazz getClazz() {
		return clazz;
	}
	public void setClazz(Clazz clazz) {
		this.clazz = clazz;
	}
	@ManyToOne()
	@Cascade (org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	@JoinColumn(name="TID",nullable=false)
	public Teacher getTeacher() {
		return teacher;
	}
	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}
	
	
 

}
